package com.zf.yichat.service.impl;

import com.zf.yichat.dto.StGoodsDto;
import com.zf.yichat.dto.StGoodsRedeemedDto;
import com.zf.yichat.mapper.StGoodsMapper;
import com.zf.yichat.mapper.StGoodsRedeemedMapper;
import com.zf.yichat.model.StGoods;
import com.zf.yichat.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private StGoodsMapper goodsMapper;

    @Autowired
    private StGoodsRedeemedMapper goodsRedeemedMapper;

    @Override
    public List<StGoodsDto> queryGoodsList() {
        return goodsMapper.queryGoodsList();
    }

    @Override
    public List<StGoodsRedeemedDto> queryRedeemedGoodsList(Long userId) {

        return goodsRedeemedMapper.queryRedeemedGoodsList(userId);
    }

    @Override
    public StGoods queryGoodsById(Integer goodsId) {
        return goodsMapper.queryGoodsById(goodsId);
    }
}
